load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "colexecdisk",
    srcs = [
        "disk_spiller.go",
        "external_distinct.go",
        "external_hash_aggregator.go",
        "external_hash_joiner.go",
        "external_sort.go",
        "hash_based_partitioner.go",
        "utils.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecdisk",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/col/coldata",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/colcontainer",
        "//pkg/sql/colexec",
        "//pkg/sql/colexec/colexecagg",
        "//pkg/sql/colexec/colexecargs",
        "//pkg/sql/colexec/colexecbase",
        "//pkg/sql/colexec/colexechash",
        "//pkg/sql/colexec/colexecjoin",
        "//pkg/sql/colexec/colexecutils",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfra/execopnode",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/types",
        "//pkg/util/buildutil",
        "//pkg/util/humanizeutil",
        "//pkg/util/log",
        "//pkg/util/mon",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_marusama_semaphore//:semaphore",
    ],
)

go_test(
    name = "colexecdisk_test",
    srcs = [
        "external_sort_test.go",
        "inject_setup_test.go",
        "main_test.go",
    ],
    embed = [":colexecdisk"],
    deps = [
        "//pkg/col/coldata",
        "//pkg/col/coldataext",
        "//pkg/settings/cluster",
        "//pkg/sql/colcontainer",
        "//pkg/sql/colexec",
        "//pkg/sql/colexec/colbuilder",
        "//pkg/sql/colexec/colexecargs",
        "//pkg/sql/colexec/colexectestutils",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/sem/eval",
        "//pkg/sql/types",
        "//pkg/testutils/colcontainerutils",
        "//pkg/testutils/skip",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/randutil",
        "@com_github_marusama_semaphore//:semaphore",
        "@com_github_stretchr_testify//require",
    ],
)
